import request from "@/utils/request";

export function saveCourseInfo(courseInfo) {
  return request({
    url: `/admin/eduCourse/addCourse`,
    method: "post",
    data: courseInfo
  });
}

export function getCourseInfoById(id) {
  return request({
    url: `/admin/eduCourse/getCourseInfo/${id}`,
    method: "get"
  });
}

export function updateCourseInfo(courseInfo) {
  return request({
    url: `/admin/eduCourse/updateCourseInfo`,
    method: "put",
    data: courseInfo
  });
}

export function getPageList(page, limit, searchObj) {
  return request({
    url: `/admin/eduCourse/list/${page}/${limit}`,
    method: "get",
    params: searchObj
  });
}

export function removeCourseById(id) {
  return request({
    url: `/admin/eduCourse/remove/${id}`,
    method: "delete"
  });
}

export function getCoursePublishById(id) {
  return request({
    url: `/admin/eduCourse/getCoursePublish/${id}`,
    method: "get"
  });
}

export function releaseCourse(id) {
  return request({
    url: `/admin/eduCourse/releaseCourse/${id}`,
    method: "put"
  });
}
